package main

import (
	"fmt"
	"net/rpc"
)

type HelloService struct {
}

func (s *HelloService) Hello(request string, reply *string) error {
	*reply = "hello" + request
	return nil
}
func main() {
	dial, err := rpc.Dial("tcp", "localhost:1234")
	if err != nil {
		panic("连接失败")
	}
	var reply string
	err = dial.Call("HelloService.Hello", "huran", &reply)
	if err != nil {
		panic("调用失败")
	}
	fmt.Println(reply)
}
